<html>
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" charset="utf-8" src="/common/js/framework.js"></script>
    <style>
        /*回到顶部图标*/
        .collection {
            position: fixed;
            left: 0;
            top: 800px;
            width: 40px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            background-color: #CA0C16;
            font-weight: bold;
            color: #fff;
        }

        .collection .iconfont {
            font-size: 20px;
        }

        .collection span {
            display: none;
        }

        /*回到顶部图标结束*/
    </style>
</head>
<body>
<!-- 收藏图标，用模板引擎渲染 -->
<div id="collectionTemplate"></div>
<script type="text/html" id="tpl1">
    <a href='https://www.baidu.com'>
        <div class='collection'>
            <i class='iconfont'>&#xe61f;</i>
            <span>{{iconText}}</span>
        </div>
    </a>
</script>
<script>
    var text = {
        iconText: "收藏"
    };
    $("#collectionTemplate").html(template("tpl1", text));
</script>
</body>
</html>
